#pragma once
#include <unistd.h>
#include <pthread.h>

class Mutex
{
public:
    Mutex()
    {
        _lock = PTHREAD_MUTEX_INITIALIZER;
    }

    void lock()
    {
        pthread_mutex_lock(&_lock);
    }

    void unlock()
    {
        pthread_mutex_unlock(&_lock);
    }

    pthread_mutex_t* get()
    {
        return &_lock;
    }
private:
    pthread_mutex_t _lock;
};